<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 标签选择器 */
        div{
            color: red;
            font-size: 30px;
        }
        /* 类选择器 */
        .hello{
            background: pink;
        }
        .world{
            font-weight: bold;
            width: 400px;
        }
        .b2{
            height: 100px;
        }
        /* id选择器 */
        p#welcome{
            background: green;
        }
        /* 复合选择器 */
        div.happy{
            font-size: 40px;
            text-decoration: underline;
        }
        /* 组合选择器,也称为集体声明 */
        h3,div.a1,.a2{
            background: green;
            font-size: 30px;
            width: 300px;
            height: 200px;
        }
        /* 嵌套选择器 */
        div span{
            background: orange;
        }
        /* 伪类选择器 */
        /* a:link{
            background: black;
        }
        a:visited{
            background: red;
        }
        a:hover{
            background: blue;
        }
        a:active{
            background: green;
        } */
        a:link{
            color: black;
            text-decoration: none;
        }
        a:visited{
            color: rgb(43, 42, 42);
        }
        a:hover,a:active{
            text-decoration: underline;
            color: orange;
        }
       
    </style>
</head>
<body>
    <!-- 通过class属性调用类选择器 -->
    <div class="hello world b2">aaa</div>
    <!-- 通过id属性调用id选择器，必须是唯一 -->
    <p id="welcome">bbb</p>
    <span class="hello">ccc</span>
    <div class="happy">ddd</div>
    <h3>eee</h3>
    <div class="a1">fff</div>
    <p class="a2">ggg</p>
    <span>嘿嘿</span>
    <div>
        <span>哈哈</span>
    </div>
    <hr>

    <a href="http://www.baidu.com">百度</a>
</body>
</html>